home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / system / dirto501.zip / DIRTOTAL.DOC < prev    next >
Text File  |  1995-01-07  |  18KB  |  388 lines

  1. DIRTOTAL.DOC
  2. 01/07/95
  3.  
  4. The DIRTOTAL.EXE program is another directory-listing program.  It produces a
  5. text file with the results of your search and is primarily designed for
  6. inventory purposes.  It includes these features:
  7.  
  8.   * Can search an entire drive or part of a drive
  9.   * Can search multiple drives
  10.   * Can look for individual files or all files
  11.   * Can select based on attributes, date, or size
  12.   * Can extract information for archive files (ZIP, LZH, etc)
  13.   * Can look for duplicate file names
  14.   * Can produce a couple of different report formats
  15.   * Works on a CD-ROM and network drives
  16.  
  17. DIRTOTAL goes through all directories on a given drive (or on multiple drives)
  18. and writes out the names and space used for all files on that drive.  You
  19. will also see directory totals and such.  (You can suppress the individual file
  20. names listing if you want.)
  21.  
  22. Alternatively, you can have the utility restrict the search to just those files
  23. within a given subdirectory and its child subdirectories.  For example, if you
  24. had a directory structure like this:
  25.  
  26.         +-- DOS
  27.         +-- TC -+-- KERMIT
  28.         |       +-- BANYAN
  29.         +-- 123
  30.  
  31. If you pass in just the drive designation, you will get files in all
  32. subdirectories.  If you pass in "C:\TC", you'll get all files in C:\TC,
  33. C:\TC\KERMIT, and C:\TC\BANYAN.
  34.  
  35. DIRTOTAL then tries to total up the space used by subdirectory as well as for
  36. the entire disk.  The routine also presents subtotals for directories with
  37. children.  For networked and CD-ROM discs, it will typically present the wrong
  38. results when it comes to total disk space and total free space but the file and
  39. directory totals will all be correct.
  40.  
  41. DIRTOTAL creates an output file in the default directory on the C: drive called
  42. "DRIVE#s.DIR" (where "s" is the letter of the drive you scanned) which contains
  43. the file listings and total size reports.  If you restrict the output to a
  44. specific subdirectory and its children, the file name created will be called
  45. "DRIVE#sx.DIR", where "x" is the first letter of the restriction ("DIRTOTAL
  46. C:\TC" would create a file called "DRIVE#CT.DIR").  If you ask for more than one
  47. drive at a time (e.g. "DIRTOTAL C: D: E:"), the file name will put the number of
  48. drives scanned in place of the drive letter (so "DIRTOTAL C: D: E: \TC" would
  49. create a file called "DRIVE#3T.DIR").
  50.  
  51. The DIRTOTAL.EXE program was originally written in order to find out how much space the
  52. various files took on a CD-ROM disc.  However, the command also works fine on
  53. large disk drives and network drives.  It was modeled after Norton's FF (File
  54. Find) command.
  55.  
  56.  
  57. Note:  When examining the output report, you may find some weirdly-named
  58. eight-character file names (typically beginning with "A" or "B") in your root
  59. directory.  Typically, these will show up if you run DIRTOTAL on your C drive.
  60. These files are temporary ISAM files created by the routine.  They are deleted
  61. once the program is run.
  62.  
  63.  
  64. Specifying parameters:
  65.  
  66. Parameters for this program can be set in the following ways.  The last setting
  67. encountered always wins:
  68.   - Read from an *.INI file (see below),
  69.   - Through the use of an environmental variable (SET DIRTOTAL=whatever), or
  70.   - From the command line (see "Syntax" below)
  71.  
  72.  
  73. The DIRTOTAL.INI file:
  74.  
  75. DIRTOTAL will read a DIRTOTAL.INI file if one is found.  (You can specify a
  76. different file name if desired.) The file is an ASCII text file that can be
  77. created maintained by hand.  The file can consist or one or more command line
  78. parameters (only those that begin with a "/"; no multi-word ones), one statement
  79. per line.
  80.  
  81. The file can also contain comments which are blank lines or any line beginning
  82. with:
  83.         ;    (semi-colon)
  84.         :    (colon)
  85.         '    (quote)
  86.  
  87. DIRTOTAL looks for the initialization file in your default subdirectory first.
  88. It then searches for it in the subdirectory where the executable was and then
  89. goes through your DOS path.
  90.  
  91. Passing in "/-I" or "/INULL" skips loading the INI file.  This saves some
  92. execution time as the program does not need to search your path for the file.
  93.  
  94.  
  95.  
  96. Syntax:
  97.  
  98.     DIRTOTAL [ [ drive: ] ... [drive:][filespec] |
  99.         [ drive: ] ... [drive:]\path[\filespec] ]
  100.       [ /NORMAL | /WIDE | /THIN | /SPLIT ] [ /DUPS ] [ /CHILD ]
  101.       [ /NL ] [ /-HEADERS ] [ /-FOOTERS ] [ /CLUSTERS | /-CLUSTERS ]
  102.       [ /S { GT | GE | LT | LE | EQ | NE } value ]
  103.       [ /D { GT | GE | LT | LE | EQ | NE } mm/dd/yy ] [ /ATTR=attr ]
  104.       [ /Frptfile ] [ /Z | /-Z ] [ /Iinitfile | /-I ]
  105.       [ /SUB1 | /-SUB1 ] [ /SUB2 | /-SUB2 ] [ /+DIR | /-DIR ] [ /n ]
  106.       [ /Ox | /O-x ] [ /BEEP | /-BEEP ] [ /Td: | /Td:\path ] [ /Q ] [ /? ]
  107.  
  108. where:
  109.  
  110. "drive" is the letter of the drive you want to scan ("C", "D", "L", etc).  If no
  111. drive is specified, the routine presumes you want all files from your default
  112. drive.  You can specify multiple drives if you want.
  113.  
  114. "filespec" restricts the listing to files that meet some file specification.
  115. The restriction can include wildcards.  For example, "DIRTOTAL C:\*.BAS".  Note
  116. that you can put a space between the drive and the path/filespec but not within
  117. the path/filespec (don't try "DIRTOTAL C:  \TC *.BAS" but "DIRTOTAL C:
  118. \TC\*.BAS" and "DIRTOTAL C:\TC\*.BAS" are fine).  (One quirk:  If you specify a
  119. filespec, the program will not show parent subdirectory totals for parent
  120. subdirectories that are empty.)
  121.  
  122. "path" restricts the listing to a subdirectory and its children.
  123.  
  124. "/NORMAL" is typically the default report format.  It produces a report which is
  125. 80-characters wide and has the complete file name listed on each line like this:
  126.  
  127. C:\ACD.IDX                                      09/26/93 00:34:50        575  a
  128. C:\AUTOEXEC.BAT                                 08/20/93 00:08:42        845  a
  129. C:\BOOT.CPS                                     05/06/93 18:56:28      1,024h
  130. C:\CHKLIST.CPS                                  05/20/93 22:23:06        135  a
  131. C:\CMOS.CPS                                     05/06/93 18:56:28         48
  132.  
  133. Note the last four characters show any special attributes set for the file:
  134.         a = archive bit set (the file hasn't been backed up yet)
  135.         h = hidden bit set
  136.         s = system file bit set
  137.         r = read-only file bit set
  138.  
  139.  
  140. "/WIDE" produces a 126-character wide report with all of the information in
  141. fixed columns.  This is fine for compressed printing or subsequent processing by
  142. some other program.  The field positions are as follows:
  143.  
  144.         cols  1- 65 path (including drive)
  145.              67- 78 filename (or ZIP name)
  146.              80- 91 ZIP member name (if any)
  147.              93-100 file creation date
  148.             102-109 file creation time
  149.             111-121 file size in bytes
  150.             123-126 attributes
  151.  
  152. This option invokes /Z although you can specify /-Z if you want to override it.
  153. This option is primarily designed for people who need a complete catalog of
  154. everything in a CD-ROM and programs like CATDISK choke if you exceed 4000 files
  155. per disc.
  156.  
  157. "/THIN" produces a smaller report.  The directory name is printed separately
  158. from the file name.  It automatically invokes the /CHILD option and produces a
  159. report similar to this:
  160.  
  161. C:\
  162.   ACD.IDX                   09/26/93 00:34:50         575   a
  163.   AUTOEXEC.BAT              08/20/93 00:08:42         845   a
  164.   BOOT.CPS                  05/06/93 18:56:28       1,024 h
  165.   CHKLIST.CPS               05/20/93 22:23:06         135   a
  166.  
  167. "/SPLIT" creates the results file with the filename in a fixed field within the
  168. file.  If the subdirectory name doesn't fit, it's truncated.  The /WIDE
  169. option is better if your subdirectory names exceed 35 characters (if /Z is
  170. not used) or 22 characters (if /Z is used) unless you're particular about
  171. having 80-character or less reports.  A sample of the output with /Z:
  172.  
  173. D:\CLONE22\           PB22OBJ.LZH  ADDMATI.OBJ  05/01/93 11:14:58        124
  174. D:\CLONE22\           PB22OBJ.LZH  ADDMATL.OBJ  05/01/93 11:14:58        132
  175. D:\CLONE22\           PB22OBJ.LZH  ALLEXTME.OBJ 05/01/93 11:14:58        110
  176. D:\CLONE22\           PB22OBJ.LZH  ALTKEY.OBJ   05/01/93 11:11:54      1,282
  177.  
  178. "/DUPS" produces a report which shows all files with the same file names on
  179. your disk.  By default, it produces a report that's a modified version of the
  180. /THIN report:
  181.  
  182. CHKLIST.CPS
  183.   C:\                                           05/20/93 22:23:06        135  a
  184.   C:\DOS\                                       06/27/93 21:17:12        999  a
  185.   C:\TC\KERMIT\                                 05/06/93 19:02:22        108  a
  186.   C:\TC\TELIX\                                  07/10/93 10:28:22        135  a
  187.  
  188. /DUPS is incompatible with the /SUB, /CHILD, or /NL options.  If you
  189. want to override the default /THIN report format using /DUPS, you have to
  190. specify the report format after the /DUPS option (e.g. "DIRTOTAL /DUPS
  191. /NORMAL"), not before ("DIRTOTAL /NORMAL /DUPS" will ignore the /NORMAL option).
  192.  
  193.  
  194. "/CHILD" produces a listing with directory subtotals intermixed with the regular
  195. file names.  This is useful for visual effect but a problem if you use the
  196. file as input into something else.  The option is automatically invoked for
  197. /THIN reports.  A sample:
  198.  
  199. C:\FATE\
  200.   ATLANTIS.INI              08/20/93 23:17:56         229   a
  201.   SAVEGAME.001              08/20/93 23:30:54      45,334   a
  202.     Total    2 files      45,563 bytes in C:\FATE\
  203.  
  204. "/NL" eliminates the listing of individual file names and sizes and simply gives
  205. you the subdirectory totals.  This option overrides the /Z specification.  This
  206. option is also incompatible with the /DUPS option.
  207.  
  208. "/-HEADERS" skips writing out the first couple of introductory lines in the
  209. output file which describe what options were used and such.  This is mainly of
  210. use if you plan to process the output file electronically.
  211.  
  212. "/-FOOTERS" skips writing out the summary information at the end of the output
  213. file.  This includes the directory totals and such.  This is mainly of use if
  214. you plan to process the output file electronically.
  215.  
  216. "/CLUSTERS" says to show file sizes in terms of cluster sizes (space allocated)
  217. instead of the normal bytes used.  DOS typically shows things in terms of
  218. bytes used.  Note that clusters aren't all that relevant on compressed drives
  219. or in the contents of compressed files.
  220.  
  221. "/-CLUSTERS" says to show file sizes in terms of bytes used.  This is how DOS
  222. normally shows things.  Is typically the default.
  223.  
  224. "/S xx value" says you want to limit the list of individual files to those
  225. which meet a certain size requirement.  Due to DOS's redirection commands,
  226. relations like ">" and "<" don't work so you have to use the two-letter
  227. abbreviations:
  228.  
  229.         GT      greater than                    >
  230.         GE      greater than or equal to        >=
  231.         LT      less than                       <
  232.         LE      less than or equal to           <=
  233.         EQ      equal to                        =
  234.         NE      not equal to                    <>
  235.  
  236. Having said that, the only two you're likely to use are GT and GE.  The "value"
  237. is the size value you want tested for.  So "SPACE GT 1000000" would find all
  238. individual files with a filesize greater than one million bytes.  Note that the
  239. directory total information will still indicate all files, not just the ones
  240. which meet your size limitation request.
  241.  
  242. "/D xx mm/dd/yy" says to show only those files created before or after a given
  243. date.  As before, you have to use GT, GE, LT, LE, EQ, and NE for the relational
  244. operator.  "/D GE 10/01/91" would show only those files created on or after
  245. October 1, 1991.
  246.  
  247.  
  248. "/ATTR=attr" restricts the listing to just those files with a certain attribute
  249. setting.  Valid attributes are "H" (hidden), "A" (archived), and "S" (system).
  250. So "DIRTOTAL C:\ /ATTR=A" would find all files that haven't been backed up yet.
  251.  
  252. "/Frptfile" says to write the results to a given file name.  By default, the
  253. results with go to C:DRIVE#ds.DIR, where "d" is the drive letter and "s" is the
  254. first letter of any path restriction used.  So "DIRTOTAL C:\*.*" would default
  255. to /FC:DRIVE#C.DIR.  You can say /FSCRN: if you want.  "DIRTOTAL C: /FSCRN: /NL"
  256. is useful.
  257.  
  258. "/Z" shows the contents of any ZIP, ARC, ARJ, LZH, PAK, or ZOO file too.  Is
  259. automatically invoked if /WIDE is specified.
  260.  
  261. "/-Z" reverses /Z and is the default unless /WIDE is specified.
  262.  
  263. "/Iinitfile" says to read an initialization file with the file name "initfile".
  264. The file specification *must* contain a period.  If no drive or path information
  265. is specified, the program will search for initfile beginning in your default
  266. subdirectory and then going throughout your DOS path.  The use of an
  267. initialization file is optional.  Initially defaults to "/IDIRTOTAL.INI".
  268.  
  269. "/-I" (or "/INULL") says to skip loading the initialization file.
  270.  
  271. "/SUB1" gives you subdirectory totals (how many bytes/files are in this
  272. subdirectory).  This option is only relevant if the /THIN option isn't used;
  273. /THIN automatically interweaves subdirectory totals within the listing.  This is
  274. typically the default.
  275.  
  276. "/SUB2" gives you cumulative subdirectory subtotals (including how many files
  277. and bytes are in subdirectories this level and below).  This is typically the
  278. default.
  279.  
  280. "/-SUB2" suppresses the printing of cumulative subdirectory subtotals.
  281.  
  282. "/+DIR" includes directories in the file count summary at the end of the report.
  283. This corresponds to what DOS shows when you do a DIR and is apparently useful on
  284. a Novell network.  The default is /-DIR.
  285.  
  286. "/-DIR" drops directories from the file count summary.  This is the default.
  287.  
  288.  
  289. "/n" confines the subdirectory total list to only those entries at the nth level
  290. subdirectory and above.  "/n" can be any single-digit value between 0 (only
  291. those files in the root) and 9 (typically all of them).  For example, "/1" would
  292. only show the directories off the root, not the subdirectories off of these
  293. directories.
  294.  
  295. Note that in terms of the directory total information printed using /SUB1 or
  296. /SUB2, the "/n" parameter affects which directories prints.  For /SUB1, only
  297. information up to the nth level will be shown.  For /SUB2, the cummulative
  298. totals will reflect all subdirectories below each level (as before), but the
  299. individual subdirectories themselves will not be printed out.  A useful way to
  300. find out major disk pigs by major subdirectory (when you don't really care
  301. about the individual files in each) is to say:
  302.  
  303.         DIRTOTAL /NL /1 /-SUB1 /SUB2
  304.  
  305. "/Ox" and "/O-x" allow you to specify the display order for the files.  "x" can
  306. be one of the following:
  307.  
  308.         N = file name (exclusive of directory name)
  309.         D = file date and time
  310.         S = file size of the original (non-compressed) file
  311.         O = original order (in order of directory, then filename)
  312.  
  313. If you precede the "x" with a dash ("-"), the sort will be done in reverse
  314. order.  Typically defaults to /OO.  Note that the /THIN option automatically
  315. makes the directory name the prime sorting index.
  316.  
  317. "/BEEP" gives you a beep when the program finishes.
  318.  
  319. "/-BEEP" reverses /BEEP and is typically the default.
  320.  
  321. "/Td:" specifies the drive to write any temporary ISAM files that the routine
  322. needs.  ISAM data bases are used to store and sort the file names and directory
  323. totals.  ISAM files cannot be created reliably on certain types of drives.  If a
  324. /Td: specification (e.g.  "/TC:") is not specified, the routine checks each of
  325. the following drive specifications in order:
  326.   - the drive where the report is being written to (using the /Frptfile spec if
  327.     present)
  328.   - the default drive
  329.   - drive C
  330. In each case, the program tries to skip the drive if it's either removeable or
  331. a remote (network) drive.  The latter test is often incorrect.  After that, it
  332. tries to create a file on the drive; CD-ROM drives always fail that test.
  333.  
  334. "/Td:\path" is similar to "/Td:" but it allows you to fully specify the path for
  335. the temporary output files.  If you don't specify a "/T" parameter at all or if
  336. you use "/Td:", the files will always be written to the root directory.
  337.  
  338. "/Q" turns off the file-by-file status reporting that the routine does.
  339.  
  340. "/?" or "/HELP" or "HELP" shows you the syntax for the command.
  341.  
  342.  
  343.  
  344. NOTE ON DISK SPACE:  By default, DIRTOTAL builds ISAM files with intermediate
  345. results on your C drive.  If you specify an /Frptfile parameter and include a
  346. drive specification, it will typically create the ISAM files there instead.  You
  347. can also specify the ISAM location using the /Td: or /Td:\path parameters.  Some
  348. of the files can be huge if you have a big disk to total.
  349.  
  350.  
  351. Return codes:
  352.  
  353. DIRTOTAL returns the following ERRORLEVEL codes:
  354.         0 = no problems
  355.         1 = no files found or invalid drive
  356.       253 = user aborted early
  357.       254 = internal problem finding drive to write to
  358.       255 = syntax problems, or /? requested
  359.  
  360.  
  361. Author:
  362.  
  363. This program was written by Bruce Guthrie of Wayne Software.  It is free for use
  364. and redistribution provided relevant documentation is kept with the program, no
  365. changes are made to the program or documentation, and it is not bundled with
  366. commercial programs or charged for separately.  People who need to bundle it in
  367. for-sale packages must pay a $50 registration fee to "Wayne Software" at the
  368. following address.
  369.  
  370. Additional information about this and other Wayne Software programs can be found
  371. in the file BRUCEymm.DOC which should be included in the original ZIP file.
  372. ("ymm" is replaced by the last digit of the year and the two digit month of the
  373. release.  BRUCE312.DOC came out in December 1993.  This same naming convention
  374. is used in naming the ZIP file that this program was included in.) Comments and
  375. suggestions can also be sent to:
  376.  
  377.                 Bruce Guthrie
  378.                 Wayne Software
  379.                 113 Sheffield St.
  380.                 Silver Spring, MD 20910
  381.  
  382.                 fax: (301) 588-8986
  383.  
  384. See BRUCEymm.DOC file for additional contact information.
  385.  
  386. Foreign users:  Please provide an Internet e-mail address in all correspondence.
  387.  
  388.